
PROGNAME   = dataset
VERSION    = 1.00a

SRCDIR     = src
SFILES     = block.c \
			 stream.c 
IFILES     = block.h \
			 stream.h

OBJFILES   = $(patsubst %,$(SRCDIR)/%,$(SFILES))
INCFILES   = $(patsubst %,$(SRCDIR)/%,$(IFILES))

CFLAGS_GEN = -Wall -funsigned-char -g -ggdb -I/usr/local/include/ \
             -I/opt/local/include/ $(CFLAGS) -DVERSION=\"$(VERSION)\"
CFLAGS_DBG = -DLOG_STDERR=1 -DDEBUG_ALLOCATOR=1 \
             $(CFLAGS_GEN)
CFLAGS_OPT =  -O3 -Wno-format $(CFLAGS_GEN)

LDFLAGS   += -L/usr/local/lib/ -L/opt/local/lib
#LIBS      += -lcrypto -lssl -lidn -lz -lpcre

all: $(PROGNAME)

$(PROGNAME): $(SRCDIR)/$(PROGNAME).c $(OBJFILES) $(INCFILES)
	$(CC) $(LDFLAGS) $(SRCDIR)/$(PROGNAME).c -o $(PROGNAME) \
        $(CFLAGS_OPT) $(OBJFILES) $(LIBS)

debug: $(SRCDIR)/$(PROGNAME).c $(OBJFILES) $(INCFILES)
	$(CC) $(LDFLAGS) $(SRCDIR)/$(PROGNAME).c -o $(PROGNAME) \
        $(CFLAGS_DBG) $(OBJFILES) $(LIBS)

.PHONY: clean
clean:
	rm -f $(PROGNAME) *.exe src/*.o test/*.o *.o *~ a.out core core.[1-9][0-9]* *.stackdump \
	      LOG same_test

